package File;

import java.io.File;

//文件删除
public class Demo3 {
    public static void main(String[] args) throws InterruptedException {
        File file = new File("./test.txt");
//        file.delete();
        //程序执行结束再删除文件
        file.deleteOnExit();
        Thread.sleep(3000);
    }

}
